package xyz.csmcool.imchat.feignclient;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import xyz.csmcool.imutil.webVo.ResultVo;

import java.util.Map;

/**
 * @author 什锦
 * @Package xyz.csmcool.imchat.feignclient
 * @since 2022/8/24 13:05
 */

@FeignClient(name="imroom",fallback = RoomFileDegradeFeignClient.class)
@Component
public interface RoomClient {

    /**
     * 判断用户是该聊天室成员和是否被禁言*
     * @param roomId
     * @param uid
     * @return
     */
    @GetMapping("/roomsUser/is-room-user")
    public ResultVo<Map<String,Integer>> isRoomUser(@RequestParam("roomId") Integer roomId,
                                                    @RequestParam("uid") Integer uid);

    /**
     * 是否是我的朋友
     * @param uid
     * @param fid
     * @return
     */
    @GetMapping("/userFriend/is-friend")
    public ResultVo<Map<String,Boolean>> checkIsFriend(@RequestParam("uid") Integer uid,
                                                       @RequestParam("fid") Integer fid);

    /**
     * 是否是聊天室创建人
     * @param roomId
     * @param uid
     * @return
     */
    @GetMapping("/rooms/is-myroom")
    public ResultVo isMyRoom(@RequestParam("id") Integer roomId,@RequestParam("uid") Integer uid);
}
